package com.example.myweather;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

/**
 * A simple {@link Fragment} subclass.
 */
public class WeatherCityfragment extends Fragment {

public Button button;
public TextView textView;
public TextView textView2;
public TextView textView3;

    public WeatherCityfragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_cityement, container, false);
           button=view.findViewById(R.id.button2);
           textView=view.findViewById(R.id.jianyi);
           textView2=view.findViewById(R.id.chengshi);
           textView3=view.findViewById(R.id.pm);

           button.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {
             textView2.setText(CityFragment.city.getResult().get(0).getCitynm());
//             textView.setText(CityFragment.city.getResult().get(2).get);

               }
           });
        return view;
    }

}

